home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / metamail / st / em-model.txt < prev    next >
Encoding:
Text File  |  1993-05-14  |  20.0 KB  |  766 lines

  1.           draft           A Model for Enabled Mail (EM)         May 1993
  2.  
  3.  
  4.                           A Model for Enabled Mail (EM)
  5.  
  6.                              Thu May  6 22:50:18 1993
  7.  
  8.  
  9.                                  Marshall T. Rose
  10.                            Dover Beach Consulting, Inc.
  11.                               mrose@dbc.mtview.ca.us
  12.  
  13.  
  14.                                Nathaniel Borenstein
  15.                                      Bellcore
  16.                                  nsb@bellcore.com
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                Status of this Memo
  23.  
  24.           This document is a working draft.  Do not cite, copy, or
  25.           circulate.
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                                                                 [Page 1]
  55.  
  56.  
  57.  
  58.  
  59.  
  60.           draft           A Model for Enabled Mail (EM)         May 1993
  61.  
  62.  
  63.           1.  Introduction
  64.  
  65.           This memo defines an enhancement, termed Enabled Mail (EM), to
  66.           the message handling model used in computer-communications
  67.           systems.  The memo begins by describing the traditional model
  68.           for message handling.  Next, an enhancement to the model is
  69.           suggested which augments the final delivery process with
  70.           additional services.  Finally, specific technology choices are
  71.           recommended for experimental purposes within the Internet
  72.           community.
  73.  
  74.  
  75.           2.  The Traditional Model for Message Handling
  76.  
  77.           In 1979, the International Federation for Information
  78.           Processing (IFIP), a pre-standards organization, developed a
  79.           model for message handling.  This model was eventually adopted
  80.           and expanded by the the International Telephone and Telegraph
  81.           Consultative Committee (CCITT), which developed the X.400
  82.           series of recommendations.
  83.  
  84.           Pictorially, the message handling model is organized thusly:
  85.  
  86.                  +----+            messaging             +----+
  87.                  | UA | - - - - - - - - - - - - - - - -> | UA |
  88.                  +----+                                  +----+
  89.                    |                                       /|\
  90.                    |                                        |
  91.                    | posting                                | delivery
  92.                    |---------                               |----------
  93.                    |                                        |
  94.                    |                                        |
  95.                +---|---------------------------------------------+
  96.                |   |                    MTS                 |    |
  97.                |  \|/                                       |    |
  98.                | +-----+     +-----+                     +-----+ |
  99.                | | MTA | --> | MTA | --> ... --> ... --> | MTA | |
  100.                | +-----+     +-----+      relaying       +-----+ |
  101.                |                                                 |
  102.                +-------------------------------------------------+
  103.  
  104.           As shown here, electronic mail messages are transported by a
  105.           "message transfer system" (MTS), which is composed of one or
  106.           more "message transfer agents" (MTAs).  The message transfer
  107.           system is distributed in nature, and not under a single
  108.  
  109.  
  110.  
  111.  
  112.  
  113.                                                                 [Page 2]
  114.  
  115.  
  116.  
  117.  
  118.  
  119.           draft           A Model for Enabled Mail (EM)         May 1993
  120.  
  121.  
  122.           administrative entity; in contrast, a collection of message
  123.           transfer agents are usually controlled by a single
  124.           administrative entity.  At the edges of the system, a "user
  125.           agent" (UA) acts on behalf of a user to interact with the
  126.           local message transfer agent.
  127.  
  128.           From the perspective of the message transfer system, the
  129.           electronic mail message being sent is called the "content",
  130.           and all delivery information associated with the message is
  131.           called the "envelope".  In theory, the message transfer system
  132.           is ignorant of the structure of the content it transports; the
  133.           user agents bilaterally agree as to what this structure is.
  134.           Although there are no strict requirements as to the structure,
  135.           there are usually two components in each electronic mail
  136.           message: control information (often called the "headers"), and
  137.           data information (often called the "body").  A convenient way
  138.           of thinking about all these terms is:
  139.  
  140.           o    the envelope is meaningful to the message transfer
  141.                agents;
  142.  
  143.           o    the headers are meaningful to the user agents; and,
  144.  
  145.           o    the body is meaningful to the users (which may be people
  146.                or programs).
  147.  
  148.           When an electronic mail message is sent from one user to
  149.           another, the following activities occur: the originator
  150.           indicates to the user agent the address of the recipient; the
  151.           user agent places the destination address and the sender's
  152.           address into the envelope and then posts the message through a
  153.           "posting slot" to a message transfer agent, which involves a
  154.           posting protocol in which the validity of those addresses and
  155.           the syntax of the electronic mail message are considered.
  156.           Upon successful completion of the submission protocol, the
  157.           message transfer agent accepts responsibility either to
  158.           deliver the electronic mail message, or, if so requested and
  159.           if delivery fails, to inform the originator of the failure by
  160.           generating an "error report".
  161.  
  162.           After accepting responsibility to deliver the electronic mail
  163.           message, a message transfer agent must decide if it can
  164.           deliver the message directly to the recipient; if so, it
  165.           delivers the electronic mail message through a "delivery slot"
  166.           to the recipient's user agent, using a delivery protocol.  If
  167.  
  168.  
  169.  
  170.  
  171.  
  172.                                                                 [Page 3]
  173.  
  174.  
  175.  
  176.  
  177.  
  178.           draft           A Model for Enabled Mail (EM)         May 1993
  179.  
  180.  
  181.           not, it contacts an adjacent message transfer agent, which is
  182.           closer to the recipient, and negotiates transfer of the
  183.           electronic mail message.  This process repeats until some
  184.           message transfer agent is able to deliver the electronic mail
  185.           message, or some message transfer agent determines that the
  186.           message is undeliverable.
  187.  
  188.           To summarize, there are three general protocols involved in
  189.           the model:
  190.  
  191.           o    a "messaging" protocol used between two user agents;
  192.  
  193.           o    a "relaying" protocol used between two message transfer
  194.                agents; and,
  195.  
  196.           o    "submission/delivery" protocol used between a message
  197.                transfer agent and a user agent.
  198.  
  199.           In the Internet community, RFC 822 [1] and MIME [2,3] define
  200.           the messaging protocol, whilst SMTP [4] defines the relaying
  201.           protocol.  Submission and delivery protocols are considered a
  202.           local matter, although it is common to use SMTP for submission
  203.           and POP3 [5] for delivery.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.                                                                 [Page 4]
  232.  
  233.  
  234.  
  235.  
  236.  
  237.           draft           A Model for Enabled Mail (EM)         May 1993
  238.  
  239.  
  240.           3.  Enhancing the Model with Enabled Mail
  241.  
  242.           The Enabled Mail (EM) enhancement to the model occurs during
  243.           and after delivery processing.  Specifically, the model is
  244.           enhanced by viewing the delivery process as consisting of
  245.           three distinct phases:
  246.  
  247.           o    "delivery-time", which occurs immediately before the
  248.                message crosses the delivery slot;
  249.  
  250.           o    "receipt-time", which occurs immediately after the
  251.                message crosses the delivery slot; and,
  252.  
  253.           o    "activation-time", which occurs whenever the recipient
  254.                processes the message.
  255.  
  256.           In each of these phases, a user-defined program is evaluated,
  257.           each with a different execution environment.
  258.  
  259.  
  260.           3.1.  The Delivery-Time EM Phase
  261.  
  262.           Immediately before the message crosses the delivery-slot, a
  263.           program defined by the originator, if present in the message,
  264.           is evaluated by the message transfer agent performing final
  265.           delivery.  Such a program has access to the message being
  266.           delivered and its envelope, can engage in a negotiation
  267.           process with the recipient's user agent, but has no
  268.           interactive access to the recipient.
  269.  
  270.           An example of a program evaluated during Delivery-Time EM
  271.           would be something which automatically sends a delivery
  272.           acknowledgement to the originator.
  273.  
  274.           Note that any program transported through the message transfer
  275.           system must be evaluated in a "execution-safe" environment,
  276.           one in which arbitrary programs, written by an unknown or
  277.           hostile party, can be evaluated without fear of system
  278.           compromise.
  279.  
  280.  
  281.           3.2.  The Receipt-Time EM Phase
  282.  
  283.           Immediately after the message crosses the delivery slot, a
  284.           program defined by the recipient, if present in the
  285.  
  286.  
  287.  
  288.  
  289.  
  290.                                                                 [Page 5]
  291.  
  292.  
  293.  
  294.  
  295.  
  296.           draft           A Model for Enabled Mail (EM)         May 1993
  297.  
  298.  
  299.           recipient's local configuration, is evaluated by the
  300.           recipient's UA.  Such a program has access to the message
  301.           being delivered and its envelope, but has no interactive
  302.           access to the recipient.
  303.  
  304.           An example of a program evaluated during Receipt-Time EM would
  305.           be something which automatically files a message into one or
  306.           more folders, based on originator and subject.
  307.  
  308.           Note that the program evaluated during Receipt-Time EM is
  309.           provided by the recipient, and, if properly coded, should be
  310.           safe for execution in the recipient's environment.  This is
  311.           often a necessity, as many receipt-time EM activities are
  312.           likely to require the recipient's privileges when accessing
  313.           system resources.
  314.  
  315.  
  316.           3.3.  The Activation-Time EM Phase
  317.  
  318.           Whenever the recipient processes the message, e.g., for
  319.           rendering, a program defined by the originator, if present, is
  320.           evaluated by the recipient's UA.  Such a program does not have
  321.           access to the message or its envelope, but may have
  322.           interactive access to the recipient.
  323.  
  324.           An example of a program evaluated during Activation-Time EM
  325.           would be something which queries the user for some information
  326.           and then sends the response back to the originator.
  327.  
  328.           Note that any program transported through the message transfer
  329.           system must be evaluated in a "execution-safe" environment,
  330.           one in which arbitrary programs, written by an unknown or
  331.           hostile party, can be evaluated without fear of system
  332.           compromise.
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.                                                                 [Page 6]
  350.  
  351.  
  352.  
  353.  
  354.  
  355.           draft           A Model for Enabled Mail (EM)         May 1993
  356.  
  357.  
  358.           4.  An Experiment in EM for the Internet Community
  359.  
  360.           In order to foster interoperability, this memo recommends the
  361.           following EM technology choices for the Internet community.
  362.  
  363.  
  364.           4.1.  Delivery-Time EM
  365.  
  366.           If during final delivery, the message transfer agent
  367.           determines that the message is of content-type
  368.           "multipart/enabled-mail" [6], then the Delivery-Time EM phase
  369.           is entered.  When this phase terminates, the entire message is
  370.           delivered to the recipient's user agent.
  371.  
  372.           This content-type contains two parts, the first is an
  373.           arbitrary content-type, and the second is of content-type
  374.           "application/safe-tcl" with parameter "evaluation-
  375.           time=delivery".  Safe-Tcl [6] is a subset of the Tcl [7]
  376.           environment which is believed to be safe for evaluating
  377.           programs written by an unknown or hostile party.
  378.  
  379.  
  380.           4.2.  Receipt-Time EM
  381.  
  382.           If the recipient's user agent has been configured to evaluate
  383.           a Tcl script when messages are received, then the Receipt-Time
  384.           EM phase is entered whenever final delivery occurs for that
  385.           recipient.
  386.  
  387.           The Tcl script will be evaluated with the recipient's
  388.           privileges.  In addition to the standard Tcl environment, the
  389.           Tcl procedures and variables defined in Sections 4.2, 4.3, and
  390.           4.4 of [6] are available.
  391.  
  392.           Note that no recipient-interaction is possible during
  393.           Receipt-Time EM, as such any attempts at terminal-I/O will
  394.           always generate an error during Receipt-Time EM.
  395.  
  396.  
  397.           4.3.  Activation-Time EM
  398.  
  399.           The Activation-Time EM phase occurs whenever the recipient
  400.           renders a MIME entity containing the "application/safe-tcl"
  401.           content-type and having a parameter value of "evaluation-
  402.           time=activation".
  403.  
  404.  
  405.  
  406.  
  407.  
  408.                                                                 [Page 7]
  409.  
  410.  
  411.  
  412.  
  413.  
  414.           draft           A Model for Enabled Mail (EM)         May 1993
  415.  
  416.  
  417.           4.4.  Configuration Information
  418.  
  419.           A user agent participating in EM provides configuration
  420.           information to the local message transfer agent.  This
  421.           information includes, but is not limited to:
  422.  
  423.           (1)  customization information for Safe-Tcl's getconfigdata
  424.                primitive;
  425.  
  426.           (2)  size and time limits for the Delivery-Time, Receipt-Time,
  427.                and Activation-Time EM phases;
  428.  
  429.           (3)  a Tcl script to be evaulated during Receipt-Time EM; and,
  430.  
  431.           (4)  a collection of user-defined Tcl scripts, for use during
  432.                EM.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.                                                                 [Page 8]
  468.  
  469.  
  470.  
  471.  
  472.  
  473.           draft           A Model for Enabled Mail (EM)         May 1993
  474.  
  475.  
  476.           5.  Security Considerations
  477.  
  478.           Delivery-Time EM and Activation-Time EM should occur in
  479.           "execution-safe" environments.  Any technology choice used for
  480.           either of these phases should be the subject of intense
  481.           scrutiny.
  482.  
  483.  
  484.           6.  Acknowledgements
  485.  
  486.           Einar Stefferud of Network Management Associates suggested the
  487.           names used to denote the three phases of EM.
  488.  
  489.  
  490.           7.  Authors' Addresses
  491.  
  492.                Nathaniel S. Borenstein
  493.                MRE 2D-296
  494.                Bellcore
  495.                445 South Street
  496.                Morristown, NJ 07962-1910
  497.                US
  498.  
  499.                Phone: +1 201 829 4270
  500.                Fax:   +1 201 829 5963
  501.                Email: nsb@bellcore.com
  502.  
  503.  
  504.                Marshall T. Rose
  505.                Dover Beach Consulting, Inc.
  506.                420 Whisman Court
  507.                Mountain View, CA  94043-2186
  508.                US
  509.  
  510.                Phone: +1 415 968 1052
  511.                Fax:   +1 415 968 2510
  512.                Email: mrose@dbc.mtview.ca.us
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                                                                 [Page 9]
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           draft           A Model for Enabled Mail (EM)         May 1993
  533.  
  534.  
  535.           8.  References
  536.  
  537.           [1]  D.H. Crocker.  Standard for the Format of ARPA Internet
  538.                Text Messages.  Request for Comments 822, (August, 1982).
  539.  
  540.           [2]  N. Borenstein, N. Freed.  MIME: Mechanisms for Specifying
  541.                and Describing the Format of Internet Message Bodies.
  542.                Request for Comments 1341, (June, 1992).
  543.  
  544.           [3]  K. Moore.  Representation of Non-ASCII Text in Internet
  545.                Message Headers.  Request for Comments 1342, (June,
  546.                1992).
  547.  
  548.           [4]  J.B. Postel.  Simple Mail Transfer Protocol.  Request for
  549.                Comments 821, (August, 1982).
  550.  
  551.           [5]  M.T. Rose.  Post Office Protocol: Version 3.  Request for
  552.                Comments 1225, (May, 1991).
  553.  
  554.           [6]  N. Borenstein, M. Rose.  MIME Extensions for Mail-Enabled
  555.                Applications: application/Safe-Tcl and
  556.                multipart/enabled-mail.  Draft in preparation, (May,
  557.                1993).
  558.  
  559.           [7]  J. Ousterhout.  An Introduction to Tcl and Tk.  Addison-
  560.                Wesley, (to appear in 1993).
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.                                                                [Page 10]
  586.  
  587.  
  588.  
  589.  
  590.  
  591.           draft           A Model for Enabled Mail (EM)         May 1993
  592.  
  593.  
  594.           Appendix A.  Usage Example: Delivery-Time EM
  595.  
  596.           Here is a brief example of a program that might be evaluated
  597.           during the Delivery-Time EM phase:
  598.  
  599.                Content-Type: application/safe-tcl; evaluation-time=delivery
  600.  
  601.                sndmsg $Tcl_originator "" \
  602.                    "Delivery Notification for $Tcl_recipient"
  603.                    [getheader message-id]
  604.  
  605.           This simply sends a message to the originator indicating that
  606.           the incoming message crossed the delivery slot for the
  607.           recipient.
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.                                                                [Page 11]
  645.  
  646.  
  647.  
  648.  
  649.  
  650.           draft           A Model for Enabled Mail (EM)         May 1993
  651.  
  652.  
  653.           Appendix B.  Usage Example: Receipt-Time EM
  654.  
  655.           Here is a brief example of a program that might be evaluated
  656.           during the Receipt-Time EM phase:
  657.  
  658.                savemsg mailbox "mhbox/INCOMING"
  659.  
  660.                proc    mboxP   {header mboxes} {
  661.                    foreach     addr    [getaddrs [gethdr $header]] {
  662.                        set     local   [getaddrprop $addr local]
  663.                        foreach mbox    mboxes {
  664.                            if {regexp -nocase $mbox $local} {
  665.                                return 1
  666.                            }
  667.                        }
  668.                    }
  669.  
  670.                    return      0
  671.                }
  672.  
  673.                set     mboxlist        [list "^mrose$" "^iesg$"]
  674.                if {[mboxP To $mboxlist] || [mboxP cc $mboxlist]} {
  675.                    radiomail
  676.                }
  677.  
  678.                savemsg mailbox
  679.  
  680.           First, the incoming message is appended to the user's mailbox
  681.           named "mhbox/INCOMING".  Next, a procedure, "mboxP" is
  682.           defined.  The variable "mboxlist" is set to an array
  683.           containing two elements.  Then a check is made to see if
  684.           either the To field or the cc field contains an address having
  685.           either element as its local-part.  If so, the procedure
  686.           "radiomail" is called.  Finally, the incoming message is
  687.           appended to the user's default mailbox.
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.                                                                [Page 12]
  704.  
  705.  
  706.  
  707.  
  708.  
  709.           draft           A Model for Enabled Mail (EM)         May 1993
  710.  
  711.  
  712.           Table of Contents
  713.  
  714.  
  715.           1 Introduction ..........................................    2
  716.           2 The Traditional Model for Message Handling ............    2
  717.           3 Enhancing the Model with Enabled Mail .................    5
  718.           3.1 The Delivery-Time EM Phase ..........................    5
  719.           3.2 The Receipt-Time EM Phase ...........................    5
  720.           3.3 The Activation-Time EM Phase ........................    6
  721.           4 An Experiment in EM for the Internet Community ........    7
  722.           4.1 Delivery-Time EM ....................................    7
  723.           4.2 Receipt-Time EM .....................................    7
  724.           4.3 Activation-Time EM ..................................    7
  725.           4.4 Configuration Information ...........................    8
  726.           5 Security Considerations ...............................    9
  727.           6 Acknowledgements ......................................    9
  728.           7 Authors' Addresses ....................................    9
  729.           8 References ............................................   10
  730.            A.  Usage Example: Delivery-Time EM ....................   11
  731.            B.  Usage Example: Receipt-Time EM .....................   12
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.                                                                [Page 13]
  763.  
  764.  
  765.  
  766.